package swing;

import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;

import travel.Travel_Information_VO;

import java.awt.Dimension;
import java.awt.Panel;
import java.awt.TexturePaint;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.Font;
import javax.swing.SwingConstants;
import java.awt.ComponentOrientation;
import javax.swing.UIManager;



public class Giyuc extends JPanel {
	private String imgPath = "/image/";
	private String imgExt = ".jpg";
	private JFrame p;
	public Giyuc( ) {
		this.p = p;
		setLayout(null);
		Dimension size = new Dimension();//사이즈를 지정하기 위한 객체 생성
		size.setSize(980, 660);//객체의 사이즈를 지정
		setPreferredSize(new Dimension(980, 800));
		setBackground(Color.black);
		
		JLabel lblNewLabel = new JLabel("당신의 설레이는 첫날을 장식할 장소를 소개합니다!");
		lblNewLabel.setForeground(new Color(248, 248, 255));
		lblNewLabel.setHorizontalTextPosition(SwingConstants.CENTER);
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setFont(new Font("맑은 고딕", Font.BOLD, 19));
		lblNewLabel.setBounds(25, 28, 447, 52);
		add(lblNewLabel);
		
		
		JTextPane txtpnSssss = new JTextPane();
		txtpnSssss.setEditable(false);
		txtpnSssss.setFont(new Font("맑은 고딕", Font.PLAIN, 14));
		txtpnSssss.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
		txtpnSssss.setBackground(Color.WHITE);
		txtpnSssss.setBounds(25, 83, 447, 125);
		txtpnSssss.setText("당신의 첫날에 어울리는 장소는 어디일까요? \r" +
				"세계적인 휴양지 몰디브? \r" +
				"신혼의 꿈 하와이? \r" +
				"아니면 그 누구도 경험해보지 못한 장소를? \r" +
				"선택하세요! 누구에게나 '처음'은 소중하니까요! ");
		add(txtpnSssss);
	
		add(makeButton1("santo_480_1"));
		add(makeButton2("santo_480_1"));
		add(makeButton3("santo_480_1"));
		add(makeButton4("santo_480_1"));
		add(makeButton5("santo_480_1"));
		add(makeButton6("santo_480_1"));
		add(makeButton7("santo_480_1"));
		
	}
	
		
	
	
	
	private JButton makeButton1(String img) {
		JButton 하와이 = new JButton();
		하와이.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "하와이" );
				eventUp.show();
				
			}
		});
		하와이.setFocusPainted(false);
		하와이.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		하와이.setIcon( new ImageIcon(iconPach));
		하와이.setBounds(25, 236, 281, 180);
		return 하와이;
}
	private JButton makeButton2(String img) {
		JButton 그리스 = new JButton();
		그리스.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "그리스" );
				eventUp.show();
			}
		});
		그리스.setFocusPainted(false);
		그리스.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		그리스.setIcon( new ImageIcon(iconPach));
		그리스.setBounds(353, 236, 281, 180);
		return 그리스;
	}
	private JButton makeButton3(String img) {
		JButton 한국 = new JButton();
		한국.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "한국" );
				eventUp.show();
			}
		});
		한국.setFocusPainted(false);
		한국.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		한국.setIcon( new ImageIcon(iconPach));
		한국.setBounds(25, 446, 339, 180);
		return 한국;
	}
	private JButton makeButton4(String img) {
		JButton 그외 = new JButton();
		그외.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "그외" );
				eventUp.show();
			}
			
		});
		
		그외.setFocusPainted(false);
		그외.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		그외.setIcon( new ImageIcon(iconPach));
		그외.setBounds(769, 446, 181, 180);
		return 그외;
	}
	private JButton makeButton7(String img) {
		JButton 발리 = new JButton();
		발리.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "발리" );
				eventUp.show();
			}
			
		});
		
		발리.setFocusPainted(false);
		발리.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		발리.setIcon( new ImageIcon(iconPach));
		발리.setBounds(669, 236, 281, 180);
		return 발리;
	}
	private JButton makeButton5(String img) {
		JButton 호주 = new JButton();
		호주.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "호주" );
				eventUp.show();
			}
		});
		
		호주.setFocusPainted(false);
		호주.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		호주.setIcon( new ImageIcon(iconPach));
		호주.setBounds(522, 28, 428, 180);
		return 호주;
	}
	private JButton makeButton6(String img) {
		JButton 몰디브 = new JButton();
		몰디브.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				GiyucEvent eventUp = new GiyucEvent( p, "몰디브" );
				eventUp.show();
			}
		});
		몰디브.setFocusPainted(false);
		몰디브.setActionCommand(img);
		
		URL iconPach = getClass().getResource(
				imgPath + img +imgExt);
		몰디브.setIcon( new ImageIcon(iconPach));
		몰디브.setBounds(395, 446, 339, 180);
		return 몰디브;
	}
}
